home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 July
/
Macworld (1999-07).dmg
/
Serious Software
/
OpenWorld demo 2.0
/
Development
/
Headers
/
OpenWorld_plugIn.h
next >
Wrap
Text File
|
1999-04-24
|
4KB
|
114 lines
/*
OpenWorld_plugIn.h
OpenWorld API Interface
Version 2.0
Copyright ©1998-99, Marco Bambini, Inc. All rights reserved.
*/
#ifndef __OPENWORLD_PLUGIN__
#define __OPENWORLD_PLUGIN__
#include <MixedMode.h>
#include <OSA.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "WSAPI.h"
// Types
typedef struct
{ long message; // type of operation to perform
long version; // plug-in version
long customData; // plug-in custom data
char *search; // the search argument
const char *inputText; // text passed by OpenWorld
char *outputText; // text returned from the plug-in
long dim; // lenght of the input/output text
FSSpec myFile; // FSSpec to the open file
short fRef; // file reference number of the open file
/* Reserved parameters DON'T USE */
char reserved0[256];
long reserved1;
long reserved2;
char reserved3[512];
short reserved4;
short reserved5;
Boolean reserved6;
long reserved7;
/* Private parameters DON'T USE*/
ComponentInstance scriptingComponent;
WSAPI_CommandPBPtr pb;
UniversalProcPtr OW_NewPtr;
UniversalProcPtr OW_NewHandle;
UniversalProcPtr OW_DisposePtr;
UniversalProcPtr OW_DisposeHandle;
UniversalProcPtr OW_GetServerInfo;
UniversalProcPtr OW_DisposeServerInfo;
UniversalProcPtr OW_TextToHTML;
} data;
typedef data *dataPtr;
// Messages
#define init_message 1L
#define run_message 2L
#define stop_message 3L
#define end_message 4L
#define kSingleTag 0
#define kDoubleTag 1
#define kVersion (long) 0x2000 // means: 2.0.0 revision 0
#define kUnused 0L
// ProcInfo
enum {
uppMainEntryProcInfo = kCStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
| STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr)))
};
enum {
uppAllocateMemProcInfo = kCStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(void *)))
| STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WSAPI_CommandPBPtr)))
| STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(long)))
};
enum {
uppFreeMemProcInfo = kCStackBased
| STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WSAPI_CommandPBPtr)))
| STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(void *)))
};
enum {
uppGetParameterProcInfo = kCStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(char *)))
| STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WSAPI_CommandPBPtr)))
| STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(WSAPI_ParamKeywords)))
| STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(unsigned long *)))
};
enum {
uppTextToHTMLProcInfo = kCStackBased
| RESULT_SIZE(SIZE_CODE(sizeof(char *)))
| STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WSAPI_CommandPBPtr)))
| STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(char *)))
| STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(long *)))
};
#define OW_NewPtr(param,dim) (char *)CallUniversalProc(param->OW_NewPtr,uppAllocateMemProcInfo,param->pb,dim)
#define OW_NewHandle(param,dim) (char *)CallUniversalProc(param->OW_NewHandle,uppAllocateMemProcInfo,param->pb,dim)
#define OW_DisposePtr(param,data) CallUniversalProc(param->OW_DisposePtr,uppFreeMemProcInfo,param->pb,data)
#define OW_DisposeHandle(param,data) CallUniversalProc(param->OW_DisposeHandle,uppFreeMemProcInfo,param->pb,data)
#define OW_GetServerInfo(param,key,num) (char *)CallUniversalProc(param->OW_GetServerInfo,uppGetParameterProcInfo,param->pb,key,num)
#define OW_DisposeServerInfo(param,data) CallUniversalProc(param->OW_DisposeServerInfo,uppFreeMemProcInfo,param->pb,data)
#define OW_TextToHTML(param,text,num) (char *)CallUniversalProc(param->OW_TextToHTML,uppTextToHTMLProcInfo,param->pb,text,num)
ProcInfoType __procinfo=uppMainEntryProcInfo;
#endif